package com.huyanqi.entity;

import java.util.Calendar;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.huyanqi.core.BaseDomainObject;
import com.huyanqi.core.util.JaxbCalendarSerializer;

@Entity
@Table(name = "d_diy")
@XmlAccessorType(XmlAccessType.FIELD)
public class Diy extends BaseDomainObject {
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Id
	@Column(name="d_id",nullable=false)
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Long dId;

	public void setDId(Long dId) {
		this.dId = dId;
	}
	public Long getDId() {
		return dId;
	}

	@Column(name="d_uid")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Long dUid;

	public void setDUid(Long dUid) {
		this.dUid = dUid;
	}
	public Long getDUid() {
		return dUid;
	}

	@Column(name="d_time")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	@XmlJavaTypeAdapter(JaxbCalendarSerializer.class)
	@Temporal(TemporalType.TIMESTAMP)	
	private Calendar dTime;

	public void setDTime(Calendar dTime) {
		this.dTime = dTime;
	}
	public Calendar getDTime() {
		return dTime;
	}

	@Column(name="d_name")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private String dName;

	public void setDName(String dName) {
		this.dName = dName;
	}
	public String getDName() {
		return dName;
	}

	@Column(name="d_img")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private String dImg;

	public void setDImg(String dImg) {
		this.dImg = dImg;
	}
	public String getDImg() {
		return dImg;
	}

	@Column(name="d_content")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private String dContent;

	public void setDContent(String dContent) {
		this.dContent = dContent;
	}
	public String getDContent() {
		return dContent;
	}

	@Transient
	private String uName;
	public String getuName() {
		return uName;
	}
	public void setuName(String uName) {
		this.uName = uName;
	}
	
	@Transient
	private String uHead;

	public String getuHead() {
		return uHead;
	}
	public void setuHead(String uHead) {
		this.uHead = uHead;
	}
	
	
}